#include <vector>
#include <cmath>
#include <stdio.h>
#include <iostream>
using namespace std;
class Solution
{
public:
    long long maxScore(vector<int> &nums, int x)
    {
        long long o = INT_MIN, e = INT_MIN;
        if (nums[0] & 1)
        {
            o = nums[0];
        }
        else
        {
            e = nums[0];
        }
        for (int i = 1; i < nums.size(); i++)
        {
            long long num = nums[i];
            if (num & 1)
            {
                o = max(o, e - x) + num;
            }
            else
            {
                e = max(e, o - x) + num;
            }
        }
        return max(e, o);
    }
};